{% extends "base.html" %}

{% block content %}
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<table width='80%' class='grid' cellspacing='1' align='center'><tr><td colspan='10' class='title' align="center">Sales and administrators list</td></tr>
<tr valign='middle' align='left'></tr>
  <tr valign='middle' align='left'>
  <td class='odd' width='10%'>ID</td>
  <td class='even' width='20%'>Name</td>
  <td class='odd' width='20%'>level</td>
  <td class='odd' width='20%'>group</td>
<td class='even' width='30%'>Action</td>  

  </tr>
  {% for salesperson in salesperson %}
 
  <tr valign='middle' align='left'>
  <td class='odd'>{{salesperson.id}}</td>
   <td class='even'>{{salesperson.name}}</td>
  <td class='odd'>{{salesperson.level}}</td>
  <td class='odd'>
	{% for item in salesgroups %}  

		{% ifequal salesperson.group item.id %} {{item.name}}{% endifequal %} 

	{% endfor %}
  </td>
<td class='even' ><a href="{% ifequal level 'sales' %}javascript:alert('No Competence');{%else%}/edit_s/{{ salesperson.id}}{%endifequal%}">Edit</a>&nbsp;&nbsp;&nbsp;<a href="{% ifequal level 'sales' %}javascript:alert('No Competence');{%else%}/del_s/{{ salesperson.id}}{%endifequal%}" onclick="return confirm('Are you sure to delete it?');">Delete</a>&nbsp;&nbsp;&nbsp;<a href="{% ifequal level 'sales' %}javascript:alert('No Competence');{%else%}/modifypwd/{{ salesperson.id}}{%endifequal%}">Modify password</a></td>
  </tr>

  {% endfor %}

      <tr><td  class='even' colspan="10" align="right"><strong>{{ hits }}</strong>&nbsp;Records&nbsp;&nbsp;

</td></tr>
</table>
{% endblock %}
